package com.mr.base.alpha.receiver;

import com.mr.base.alpha.mq.AlphaQueue;
import com.mr.base.alpha.vo.Message;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;


@Component
@RabbitListener(queues = AlphaQueue.TOPIC_ONE)
@Slf4j
public class TopicReceiverOne {

    @RabbitHandler
    public void receiverOne(final Message message, Channel channel
            , @Header(AmqpHeaders.DELIVERY_TAG) long tag){
        log.info("body 1 {} \r channel: {}" , message , channel);
    }


}
